package cn.stylefeng.guns.modular.api.controller;

import cn.stylefeng.guns.modular.ctm.service.ResumeFileService;
import cn.stylefeng.roses.core.reqres.response.ResponseData;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;

@Controller
@RequestMapping("/api/resumeFile")
@Api(tags = "附件管理")
@CrossOrigin
public class ResumeFileController {

    @Autowired
    private ResumeFileService resumeFileService;
    private Logger log = LoggerFactory.getLogger(this.getClass());

    @GetMapping(value = "/page")
    @ApiOperation(value = "简历信息分页列表", notes = "简历信息分页列表")
    @ResponseBody
    public ResponseData page(Page page) {
        return ResponseData.success(resumeFileService.page(page));
    }

//    @GetMapping(value = "/{id}")
//    @ApiOperation(value = "简历信息详情", notes = "简历信息详情")
//    @ResponseBody
//    public ResponseData getById(@PathVariable("id") String id) {
//        return ResponseData.success(resumeFileService.getById(id));
//    }

    @GetMapping("/delete/{id}")
    @ApiOperation(value = "删除简历信息", notes = "删除简历信息")
    @ResponseBody
    public ResponseData delete(@PathVariable String id) throws IOException {
        return ResponseData.success(resumeFileService.remove(id));
    }

}
